package com.wuseguang.springcloud.controller;

import com.wuseguang.springcloud.service.RoleJurisdictionServic;
import com.wuseguang.springcloud.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 角色权限 前端控制器
 * </p>
 *
 * @author
 * @since 2019-11-28
 */
@RestController
@RequestMapping("/jurisdiction")
public class RoleJurisdictionController {


    @Autowired
    private RoleJurisdictionServic jurisdictionServic;


    /**
     * @描述 查询全部二级菜单的功能
     * @创建人 zm
     * @创建时间 2019/12/1
     */
    @RequestMapping("/queryFunctionFindAll")
    public Result queryFunctionFindAll(@RequestParam(value = "schoolId") Integer schoolId) {
        return jurisdictionServic.queryFunctionFindAll(schoolId);
    }

    /**
     * @描述 教师端查个人信息
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/queryTeacherInformationById")
    public Result queryTeacherInformationById(@RequestParam(value = "id") Integer id) {
        return jurisdictionServic.queryTeacherInformationById(id);
    }


    /**
     * @描述 教师端修改密码
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/updateTeacherChangePasswordById")
    public Result updateTeacherChangePasswordById(@RequestParam(value = "id") Integer id, @RequestParam(value = "password") String password) {
        return jurisdictionServic.updateTeacherChangePasswordById(id, password);
    }


    /**
     * @描述 修改教师头像
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/updateTeacherHeadPortrait")
    public Result updateTeacherHeadPortrait(@RequestParam(value = "id") Integer id, @RequestParam(value = "headPortrait") String headPortrait) {
        return jurisdictionServic.updateTeacherHeadPortrait(id, headPortrait);
    }


    /**
     * @描述 修改学生头像
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/updateStudentHeadPortrait")
    public Result updateStudentHeadPortrait(@RequestParam(value = "id") Integer id, @RequestParam(value = "headPortrait") String headPortrait) {
        return jurisdictionServic.updateStudentHeadPortrait(id, headPortrait);
    }

    /**
     * @描述 家长端查个人信息
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/queryParentInformationById")
    public Result queryParentInformationById(@RequestParam(value = "id") Integer id) {
        return jurisdictionServic.queryParentInformationById(id);
    }

    /**
     * @描述 家长端修改小程序密码或班牌密码
     * @创建人 zm
     * @创建时间 2020/4/3
     */
    @RequestMapping("/updateParentChangePasswordById")
    public Result updateParentChangePasswordById(@RequestParam(value = "id") Integer id, @RequestParam(value = "password") String password, @RequestParam(value = "type") Integer type) {
        return jurisdictionServic.updateParentChangePasswordById(id, password, type);
    }

}
